package cn.dujc.superkid.fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.CheckBox;
import android.widget.Toast;

import com.zhy.view.flowlayout.FlowLayout;

import java.util.ArrayList;
import java.util.List;

import cn.dujc.core.ui.BaseFragment;
import cn.dujc.core.util.ToastUtil;
import cn.dujc.superkid.R;
import cn.dujc.superkid.adapter.UtilAdapter;

/**
 * A simple {@link Fragment} subclass.
 */
public class UtilFragment extends BaseFragment {
    private RecyclerView recyclerView;
    private UtilAdapter utilAdapter;
    private List<String> followList = new ArrayList<>();
    @Override
    public int getViewId() {
        return R.layout.fragment_util;
    }

    @Override
    public void initBasic(Bundle savedInstanceState) {
        initView();
        initLogic();
    }
    private void initLogic() {
        for (int i=0;i<10;i++){
            followList.add("应用题");
        }
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this.getActivity());
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(linearLayoutManager);
        recyclerView.addItemDecoration(new DividerItemDecoration(this.getActivity(), linearLayoutManager.getOrientation()));
        utilAdapter = new UtilAdapter(followList);
        recyclerView.setAdapter(utilAdapter);
    }
    private void initView() {
        recyclerView = (RecyclerView) findViewById(R.id.rv_course);
    }
}
